package org.gosdt.ew.model;

import java.util.ArrayList;
import java.util.HashMap;

import org.gosdt.ew.db.AlphabetDBAccess;

/**
 * Data base entity describe alphabet in language.
 * 
 * @author anton
 * 
 */
public class Alphabet {
	private AlphabetDBAccess persistObject;

	private String letter = "";
	private String languageName = "";
	private int wordsCount = 0;

	public Alphabet(String language, String oneLetter) {
		languageName = language;
		letter = oneLetter.toLowerCase();

		persistObject = AlphabetDBAccess.create(this);
	}

	public void setLetter(String letter) {
		this.letter = letter;
	}

	public void setLanguageName(String languageName) {
		this.languageName = languageName;
	}

	public String getLetter() {
		return letter;
	}

	public int getWordsCount() {
		return wordsCount;
	}

	public void setWordsCount(int newCount) {
		wordsCount = newCount;
	}

	public String getLanguage() {
		return languageName;
	}

	
	
	public ArrayList<Alphabet> getList(HashMap<String, String> keys) {
		return persistObject.getList(keys);
	}

	public int updateCurrentRecord() {
		return persistObject.updateCurrentRecord();
	}

}
